export function getData (url,data) {
  // var url='https://www.rzkeji.com/api'+url
  let promise=new Promise((resolve ,reject) => {
    wx.request({
      url:url,
      data:data,
      method:"GET",
      header:{
        "content-type":"application/json"
      },
      success:res =>{
        resolve(res)
      },
      fail:err =>{
        reject(err)
      }
    })
  })
  return promise;
};
export function postData (url,data) {
  // var url='https://www.rzkeji.com/api'+url
  let promise=new Promise((resolve ,reject) => {
    wx.request({
      url:url,
      data:data,
      method:"POST",
      header:{
        "content-type":"application/json"
      },
      success:res =>{
        resolve(res)
      },
      fail:err =>{
        reject(err)
      }
    })
  })
  return promise;
}

export default {
  getData,
  postData
}
